<?php
/**
 * Created by PhpStorm.
 * User: XYX
 * Date: 2017/8/25
 * Time: 8:12
 */
namespace App\Transform;

use App\Consumer;
use App\Twitter;

class TwitterTransform extends Transformer{

    public function transFrom($item)
    {
        // TODO: Implement transFrom() method.

        return
            [
                'id'=>$item['id'],
                'body'=>'#'.$item['clubname'].'#'.$item['content'],
                'username'=>Consumer::findOrFail($item['consumer_id'])->nickname,
                'twitterpic'=>Twitter::findOrFail($item['id'])->twitterpics,
                'likes'=>$item['likes']
            ];
    }
}